<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/system/workbusiness/upper_machine.js此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/system/workbusiness/upper_machine.js";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'id',
                footer: "Foots",
                cnName: '机床',
                name: 'workbusiness/upper_machine',
                url: "/upper_machine/",
                sortName: "id"
            });
            const editFormFields = ref({"name":"","latheSpec":"","machine_type":"","unit":"","host":"","port":"","nc_type":"","nc_card_no":"","basic_x":"","basic_y":"","basic_z":"","tool_height":"","change_tool_x":"","change_tool_y":"","change_tool_z":"","feed_x":"","feed_y":"","feed_z":"","process_type":"","process_precision":"","itinerary_x":"","itinerary_y":"","itinerary_z":"","use_status":""});
            const editFormOptions = ref([[{"title":"机床名称","field":"name","type":"text"},
                               {"title":"机床规格","field":"latheSpec","type":"text"},
                               {"title":"机床系统","field":"machine_type","type":"text"},
                               {"title":"编号","field":"unit","type":"text"}],
                              [{"title":"主机地址","field":"host","type":"text"},
                               {"title":"端口号","field":"port","type":"text"},
                               {"title":"NC类型","field":"nc_type","type":"text"},
                               {"title":"NC卡编号","field":"nc_card_no","type":"text"}],
                              [{"title":"基准点X","required":true,"field":"basic_x","type":"text"},
                               {"title":"基准点Y","required":true,"field":"basic_y","type":"text"},
                               {"title":"基准点Z","required":true,"field":"basic_z","type":"text"},
                               {"title":"夹爪平台高度","required":true,"field":"tool_height","type":"decimal"}],
                              [{"title":"换刀位置x","field":"change_tool_x","type":"text"},
                               {"title":"换刀位置Y","field":"change_tool_y","type":"text"},
                               {"title":"换刀位置z","field":"change_tool_z","type":"text"}],
                              [{"title":"上料位置x","field":"feed_x","type":"text"},
                               {"title":"上料位置y","field":"feed_y","type":"text"},
                               {"title":"上料位置z","field":"feed_z","type":"text"}],
                              [{"title":"加工类型","field":"process_type","type":"text"},
                               {"title":"加工精度","field":"process_precision","type":"text"},
                               {"title":"平台偏差","field":"g54_supplement","type":"decimal"},
                            ],
                              [{"title":"行程X","field":"itinerary_x","type":"decimal"},
                               {"title":"行程Y","field":"itinerary_y","type":"decimal"},
                               {"title":"行程Z","field":"itinerary_z","type":"decimal"},
                            //    {"title":"状态1",bind:{ key:'enable',data:[]},"field":"use_status","type":"bool"}
                            // {"dataKey":"是否使用状态","data":[],"title":"状态","field":"use_status","type":"select"},
                            {"dataKey":"是否使用状态","data":[],"title":"状态","field":"use_status","type":"select"},
                            ]]);
            const searchFormFields = ref({});
            const searchFormOptions = ref([]);
            const columns = ref([
            {field:'unit',title:'编号',type:'int',width:110,align:'left'},
            {field:'id',title:'主键',type:'int',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'name',title:'机床名称',type:'string',width:110,align:'left',sort:true},
                       {field:'latheSpec',title:'机床规格',type:'string',width:120,align:'left'},
                       {field:'machine_type',title:'机床系统',type:'string',width:220,align:'left'},
                       {field:'unit',title:'编号',type:'int',width:110,align:'left'},
                       {field:'host',title:'主机地址',type:'string',width:110,align:'left'},
                       {field:'port',title:'端口号',type:'int',width:110,align:'left'},
                       {field:'nc_type',title:'NC类型',type:'string',width:220,align:'left'},
                       {field:'nc_card_no',title:'NC卡编号',type:'string',width:220,align:'left'},
                       {field:'basic_x',title:'基准点X',type:'decimal',width:80,require:true,align:'left'},
                       {field:'basic_y',title:'基准点Y',type:'decimal',width:80,require:true,align:'left'},
                       {field:'basic_z',title:'基准点Z',type:'decimal',width:80,require:true,align:'left'},
                       {field:'tool_height',title:'夹爪平台高度',type:'decimal',width:80,require:true,align:'left'},
                       {field:'g54_supplement',title:'平台偏移',type:'decimal',width:80,require:true,align:'left'},
                       {field:'change_tool_x',title:'换刀位置x',type:'decimal',width:80,align:'left'},
                       {field:'change_tool_y',title:'换刀位置Y',type:'decimal',width:80,align:'left'},
                       {field:'change_tool_z',title:'换刀位置z',type:'decimal',width:80,align:'left'},
                       {field:'feed_x',title:'上料位置x',type:'decimal',width:80,align:'left'},
                       {field:'feed_y',title:'上料位置y',type:'decimal',width:80,align:'left'},
                       {field:'feed_z',title:'上料位置z',type:'decimal',width:80,align:'left'},
                       {field:'process_type',title:'加工类型',type:'string',width:120,align:'left'},
                       {field:'process_precision',title:'加工精度',type:'string',width:120,align:'left'},
                       {field:'itinerary_x',title:'行程X',type:'decimal',width:120,align:'left'},
                       {field:'itinerary_y',title:'行程Y',type:'decimal',width:120,align:'left'},
                       {field:'itinerary_z',title:'行程Z',type:'decimal',width:120,align:'left'},
                       {field:'use_status',title:'状态',bind:{ key:'是否使用状态',data:[]},type:'bool',width:120,align:'left'},
                    ]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
